that is openly available on https://remix.ethereum.org/. Just make
sure that you have a connection to the Internet with a high bandwidth
and any standard browser available. I have tested Solidity samples
on Chrome.
Now, we have to click on the Solidity button, visit the “FILE
EXPLORERS” section, and then click on the “New File link” link
under the Contracts folder to create a new Solidity file. The Solidity
file comes with an extension of the .sol file. We can assign a name to
our file and see it being added to the File explorer section on the left
hand side.
2.5.5 Write a Small Program
Now, let me write a small program, compile it using the REMIX
browser, deploy it, and run it with the simplest possible approach. Do
not worry about the programming details which I will cover later on
with details. Let’s just concentrate on the environment.
Now, I have written a very simple code, which is as follows:
//SPDX-License-Identifier: SOME IDENTIFIER
pragma solidity ^0.8.10;
contract FirstContract {
constructor() {
}
function retrieveOne() public pure returns(uint){
return 1;
}
}
Please note that all Solidity files have a .sol extension.
2.5.5.1 Compiling
Compiling the Solidity program is pretty straight forward on REMIX.
Click on the “SOLIDITY COMPILER” section. Please make sure that
the right compiler is selected on the left hand side, which is a default
activity.